<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>悦动普拉提 - 专业普拉提工作室</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
    <style>
        :root {
            --primary-color: #6a8d92;
            --secondary-color: #f4f4f4;
            --accent-color: #f8b195;
        }

        body {
            font-family: 'Helvetica Neue', Arial, sans-serif;
            padding-bottom: 70px; /* 为底部导航栏留出空间 */
            background-color: #f9f9f9;
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }

        /* 主内容容器 - 修复位置不对的关键 */
        #mainContent {
            flex: 1;
            overflow-y: auto; /* 允许内容滚动 */
            height: calc(100vh - 120px); /* 减去顶部导航和底部导航的高度 */
            padding-bottom: 20px;
        }

        .navbar-brand {
            font-weight: 600;
            color: var(--primary-color);
        }

        .nav-link.active {
            color: var(--primary-color) !important;
            font-weight: 500;
        }

        .btn-primary {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
        }

        .btn-outline-primary {
            color: var(--primary-color);
            border-color: var(--primary-color);
        }

        .btn-outline-primary:hover {
            background-color: var(--primary-color);
            color: white;
        }

        .card {
            border-radius: 12px;
            overflow: hidden;
            border: none;
            box-shadow: 0 4px 8px rgba(0,0,0,0.05);
            transition: transform 0.3s ease;
        }

        .card:hover {
            transform: translateY(-5px);
        }

        .course-card .card-img-top {
            height: 150px;
            object-fit: cover;
        }

        .coach-card .card-img-top {
            height: 200px;
            object-fit: cover;
        }

        .badge-course {
            background-color: var(--accent-color);
            color: white;
        }

        .schedule-day {
            border-radius: 10px;
            background-color: white;
            padding: 15px;
            margin-bottom: 15px;
        }

        .class-slot {
            border-left: 4px solid var(--primary-color);
            padding: 10px;
            margin-bottom: 10px;
            background-color: var(--secondary-color);
            border-radius: 0 8px 8px 0;
        }

        .class-slot.booked {
            border-left-color: var(--accent-color);
        }

        .tab-content {
            padding: 15px 0;
            min-height: 100%; /* 确保内容区域填满高度 */
        }

        .profile-img {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            object-fit: cover;
            border: 3px solid white;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .vip-card {
            background: linear-gradient(135deg, #6a8d92, #8fb3b8);
            color: white;
            border-radius: 15px;
            padding: 20px;
            position: relative;
            overflow: hidden;
        }

        .vip-card::before {
            content: "";
            position: absolute;
            top: -50px;
            right: -50px;
            width: 150px;
            height: 150px;
            background-color: rgba(255,255,255,0.1);
            border-radius: 50%;
        }

        .vip-card-premium {
            background: linear-gradient(135deg, #f8b195, #f67280);
        }

        /* 底部导航栏固定定位 - 关键修改 */
        .bottom-navbar {
            position: fixed;
            bottom: 0;
            width: 100%;
            background-color: white;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
            z-index: 1000;
            height: 60px;
        }

        .bottom-navbar .nav-link {
            color: #666;
            text-align: center;
            font-size: 12px;
            padding: 8px 5px;
        }

        .bottom-navbar .nav-link.active {
            color: var(--primary-color);
        }

        .bottom-navbar .bi {
            font-size: 20px;
            display: block;
            margin-bottom: 2px;
        }

        .modal-header {
            border-bottom: none;
        }

        .form-control:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 0.25rem rgba(106, 141, 146, 0.25);
        }

        .search-bar {
            position: relative;
        }

        .search-bar .form-control {
            padding-left: 40px;
            border-radius: 20px;
            border: 1px solid #ddd;
        }

        .search-bar .bi {
            position: absolute;
            left: 15px;
            top: 10px;
            color: #999;
        }

        .filter-buttons .btn {
            margin-right: 5px;
            margin-bottom: 5px;
            border-radius: 20px;
            font-size: 14px;
        }

        /* 新增样式确保内容区域高度一致 */
        .tab-pane {
            display: none;
            height: 100%;
        }

        .tab-pane.active {
            display: block;
        }

        /* 修复内容区域滚动问题 */
        .container.mt-4.mb-5 {
            margin-bottom: 0 !important;
            padding-bottom: 20px;
        }
    </style>
</head>
<body>
<!-- 顶部导航栏 -->
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
    <div class="container">
        <a class="navbar-brand" href="#">
            <i class="bi bi-flower1 me-2"></i>悦动普拉提
        </a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav">
            <ul class="navbar-nav ms-auto">
                <li class="nav-item">
                    <a class="nav-link" href="#" data-bs-toggle="modal" data-bs-target="#loginModal">登录</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#" data-bs-toggle="modal" data-bs-target="#registerModal">注册</a>
                </li>
            </ul>
        </div>
    </div>
</nav>

<!-- 主内容区域 - 关键修改 -->
<div class="container mt-4 mb-5" id="mainContent">
    <!-- 首页内容 (默认显示) -->
    <div class="tab-pane fade show active" id="home" role="tabpanel">
        <!-- 首页内容保持不变 -->
        <div class="search-bar mb-4">
            <i class="bi bi-search"></i>
            <input type="text" class="form-control" placeholder="搜索课程、教练...">
        </div>

        <h5 class="mb-3">热门课程</h5>
        <div class="row mb-4">
            <div class="col-6 col-md-4 mb-3">
                <div class="card course-card h-100">
                    <img src="https://images.unsplash.com/photo-1545205597-3d9d02c29597?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60" class="card-img-top" alt="核心普拉提">
                    <div class="card-body">
                        <span class="badge badge-course mb-2">核心训练</span>
                        <h6 class="card-title">核心普拉提</h6>
                        <p class="card-text text-muted small">45分钟 · 中级</p>
                    </div>
                    <div class="card-footer bg-white border-0">
                        <button class="btn btn-sm btn-outline-primary w-100">立即预约</button>
                    </div>
                </div>
            </div>
            <div class="col-6 col-md-4 mb-3">
                <div class="card course-card h-100">
                    <img src="https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60" class="card-img-top" alt="塑形普拉提">
                    <div class="card-body">
                        <span class="badge badge-course mb-2">塑形减脂</span>
                        <h6 class="card-title">塑形普拉提</h6>
                        <p class="card-text text-muted small">60分钟 · 初级</p>
                    </div>
                    <div class="card-footer bg-white border-0">
                        <button class="btn btn-sm btn-outline-primary w-100">立即预约</button>
                    </div>
                </div>
            </div>
            <div class="col-6 col-md-4 mb-3">
                <div class="card course-card h-100">
                    <img src="https://images.unsplash.com/photo-1571019614242-c5c5dee9f50b?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60" class="card-img-top" alt="康复普拉提">
                    <div class="card-body">
                        <span class="badge badge-course mb-2">康复训练</span>
                        <h6 class="card-title">康复普拉提</h6>
                        <p class="card-text text-muted small">60分钟 · 私教</p>
                    </div>
                    <div class="card-footer bg-white border-0">
                        <button class="btn btn-sm btn-outline-primary w-100">立即预约</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="d-flex justify-content-between align-items-center mb-3">
            <h5>本周课表</h5>
            <a href="#" class="text-primary">查看全部</a>
        </div>

        <div class="schedule-day">
            <h6 class="text-primary">今天 · 5月15日</h6>
            <div class="class-slot">
                <div class="d-flex justify-content-between">
                    <div>
                        <strong>核心普拉提</strong>
                        <div class="text-muted small">09:00-09:45 · 张教练</div>
                    </div>
                    <button class="btn btn-sm btn-primary">预约</button>
                </div>
            </div>
            <div class="class-slot booked">
                <div class="d-flex justify-content-between">
                    <div>
                        <strong>塑形普拉提</strong>
                        <div class="text-muted small">10:30-11:30 · 李教练</div>
                    </div>
                    <span class="badge bg-success">已预约</span>
                </div>
            </div>
            <div class="class-slot">
                <div class="d-flex justify-content-between">
                    <div>
                        <strong>康复普拉提</strong>
                        <div class="text-muted small">18:00-19:00 · 王教练</div>
                    </div>
                    <button class="btn btn-sm btn-primary">预约</button>
                </div>
            </div>
        </div>

        <div class="d-flex justify-content-between align-items-center mb-3 mt-4">
            <h5>推荐教练</h5>
            <a href="#" class="text-primary">查看全部</a>
        </div>

        <div class="row">
            <div class="col-6 col-md-4 mb-3">
                <div class="card coach-card h-100">
                    <img src="https://images.unsplash.com/photo-1560250097-0b93528c311a?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60" class="card-img-top" alt="张教练">
                    <div class="card-body text-center">
                        <h6 class="card-title mb-1">张教练</h6>
                        <p class="card-text text-muted small">普拉提认证教练 · 5年经验</p>
                        <div class="d-flex justify-content-center">
                            <span class="badge bg-light text-dark me-1">核心训练</span>
                            <span class="badge bg-light text-dark">塑形减脂</span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-6 col-md-4 mb-3">
                <div class="card coach-card h-100">
                    <img src="https://images.unsplash.com/photo-1573497019940-1c28c88b4f3e?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60" class="card-img-top" alt="李教练">
                    <div class="card-body text-center">
                        <h6 class="card-title mb-1">李教练</h6>
                        <p class="card-text text-muted small">康复普拉提专家 · 8年经验</p>
                        <div class="d-flex justify-content-center">
                            <span class="badge bg-light text-dark me-1">康复训练</span>
                            <span class="badge bg-light text-dark">孕产普拉提</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 课程页面内容 -->
    <div class="tab-pane fade" id="courses" role="tabpanel">
        <h5 class="mb-3">全部课程</h5>

        <div class="filter-buttons mb-4">
            <button class="btn btn-sm btn-primary">全部</button>
            <button class="btn btn-sm btn-outline-primary">核心训练</button>
            <button class="btn btn-sm btn-outline-primary">塑形减脂</button>
            <button class="btn btn-sm btn-outline-primary">康复训练</button>
            <button class="btn btn-sm btn-outline-primary">孕产普拉提</button>
            <button class="btn btn-sm btn-outline-primary">私教课程</button>
        </div>

        <div class="list-group">
            <a href="#" class="list-group-item list-group-item-action">
                <div class="d-flex justify-content-between">
                    <div>
                        <h6 class="mb-1">核心普拉提</h6>
                        <small class="text-muted">45分钟 · 中级 · 张教练</small>
                    </div>
                    <span class="badge bg-primary">核心训练</span>
                </div>
            </a>
            <a href="#" class="list-group-item list-group-item-action">
                <div class="d-flex justify-content-between">
                    <div>
                        <h6 class="mb-1">塑形普拉提</h6>
                        <small class="text-muted">60分钟 · 初级 · 李教练</small>
                    </div>
                    <span class="badge bg-primary">塑形减脂</span>
                </div>
            </a>
            <a href="#" class="list-group-item list-group-item-action">
                <div class="d-flex justify-content-between">
                    <div>
                        <h6 class="mb-1">康复普拉提</h6>
                        <small class="text-muted">60分钟 · 私教 · 王教练</small>
                    </div>
                    <span class="badge bg-primary">康复训练</span>
                </div>
            </a>
            <a href="#" class="list-group-item list-group-item-action">
                <div class="d-flex justify-content-between">
                    <div>
                        <h6 class="mb-1">孕产普拉提</h6>
                        <small class="text-muted">45分钟 · 初级 · 李教练</small>
                    </div>
                    <span class="badge bg-primary">孕产普拉提</span>
                </div>
            </a>
            <a href="#" class="list-group-item list-group-item-action">
                <div class="d-flex justify-content-between">
                    <div>
                        <h6 class="mb-1">私教一对一</h6>
                        <small class="text-muted">60分钟 · 定制 · 所有教练</small>
                    </div>
                    <span class="badge bg-primary">私教课程</span>
                </div>
            </a>
        </div>
    </div>

    <!-- 预约页面内容 -->
    <div class="tab-pane fade" id="schedule" role="tabpanel">
        <h5 class="mb-3">课程预约</h5>

        <div class="mb-4">
            <ul class="nav nav-tabs" id="scheduleTabs" role="tablist">
                <li class="nav-item" role="presentation">
                    <button class="nav-link active" id="week-tab" data-bs-toggle="tab" data-bs-target="#week" type="button">本周</button>
                </li>
                <li class="nav-item" role="presentation">
                    <button class="nav-link" id="month-tab" data-bs-toggle="tab" data-bs-target="#month" type="button">本月</button>
                </li>
                <li class="nav-item" role="presentation">
                    <button class="nav-link" id="private-tab" data-bs-toggle="tab" data-bs-target="#private" type="button">私教预约</button>
                </li>
            </ul>

            <div class="tab-content mt-3">
                <div class="tab-pane fade show active" id="week" role="tabpanel">
                    <div class="schedule-day">
                        <h6 class="text-primary">周一 · 5月15日</h6>
                        <div class="class-slot">
                            <div class="d-flex justify-content-between">
                                <div>
                                    <strong>核心普拉提</strong>
                                    <div class="text-muted small">09:00-09:45 · 张教练</div>
                                </div>
                                <button class="btn btn-sm btn-primary">预约</button>
                            </div>
                        </div>
                        <div class="class-slot">
                            <div class="d-flex justify-content-between">
                                <div>
                                    <strong>塑形普拉提</strong>
                                    <div class="text-muted small">10:30-11:30 · 李教练</div>
                                </div>
                                <button class="btn btn-sm btn-primary">预约</button>
                            </div>
                        </div>
                    </div>

                    <div class="schedule-day">
                        <h6 class="text-primary">周二 · 5月16日</h6>
                        <div class="class-slot">
                            <div class="d-flex justify-content-between">
                                <div>
                                    <strong>康复普拉提</strong>
                                    <div class="text-muted small">18:00-19:00 · 王教练</div>
                                </div>
                                <button class="btn btn-sm btn-primary">预约</button>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="tab-pane fade" id="month" role="tabpanel">
                    <div class="text-center py-4">
                        <h6>选择日期查看课程</h6>
                        <div class="my-3">
                            <button class="btn btn-outline-primary mx-1">5月</button>
                            <button class="btn btn-outline-secondary mx-1">6月</button>
                        </div>
                        <div id="calendar" class="d-flex flex-wrap justify-content-center">
                            <!-- 日历日期将通过JavaScript动态生成 -->
                        </div>
                    </div>
                </div>

                <div class="tab-pane fade" id="private" role="tabpanel">
                    <div class="mb-3">
                        <label class="form-label">选择教练</label>
                        <select class="form-select">
                            <option selected>所有教练</option>
                            <option>张教练</option>
                            <option>李教练</option>
                            <option>王教练</option>
                        </select>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">选择日期</label>
                        <input type="date" class="form-control">
                    </div>
                    <div class="mb-3">
                        <label class="form-label">选择时间</label>
                        <select class="form-select">
                            <option selected>选择时间段</option>
                            <option>09:00-10:00</option>
                            <option>10:30-11:30</option>
                            <option>14:00-15:00</option>
                            <option>18:00-19:00</option>
                        </select>
                    </div>
                    <button class="btn btn-primary w-100">提交预约申请</button>
                </div>
            </div>
        </div>
    </div>

    <!-- 会员中心内容 -->
    <div class="tab-pane fade" id="member" role="tabpanel">
        <div class="text-center mb-4">
            <img src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60" class="profile-img mb-2" alt="会员头像">
            <h5>张女士</h5>
            <p class="text-muted">黄金会员 · 到期日: 2023-12-31</p>
        </div>

        <div class="card mb-4">
            <div class="card-body">
                <h6 class="card-title">我的课程</h6>
                <div class="d-flex justify-content-between mb-2">
                    <span class="text-muted">已预约</span>
                    <strong>12节</strong>
                </div>
                <div class="d-flex justify-content-between mb-2">
                    <span class="text-muted">已完成</span>
                    <strong>8节</strong>
                </div>
                <div class="d-flex justify-content-between">
                    <span class="text-muted">剩余</span>
                    <strong>4节</strong>
                </div>
            </div>
        </div>

        <div class="card mb-4">
            <div class="card-body">
                <h6 class="card-title mb-3">我的预约</h6>
                <div class="class-slot booked mb-2">
                    <div class="d-flex justify-content-between">
                        <div>
                            <strong>塑形普拉提</strong>
                            <div class="text-muted small">5月15日 10:30-11:30 · 李教练</div>
                        </div>
                        <button class="btn btn-sm btn-outline-danger">取消</button>
                    </div>
                </div>
                <div class="class-slot booked">
                    <div class="d-flex justify-content-between">
                        <div>
                            <strong>康复普拉提</strong>
                            <div class="text-muted small">5月18日 18:00-19:00 · 王教练</div>
                        </div>
                        <button class="btn btn-sm btn-outline-danger">取消</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="card mb-4">
            <div class="card-body">
                <h6 class="card-title mb-3">会员卡</h6>
                <div class="vip-card mb-3">
                    <h6>黄金会员卡</h6>
                    <p class="small">有效期至: 2023-12-31</p>
                    <div class="d-flex justify-content-between align-items-center">
                        <div>
                            <h4 class="mb-0">12节</h4>
                            <small>剩余: 4节</small>
                        </div>
                        <button class="btn btn-sm btn-light">续费</button>
                    </div>
                </div>
                <button class="btn btn-outline-primary w-100" data-bs-toggle="modal" data-bs-target="#vipModal">购买新会员卡</button>
            </div>
        </div>

        <div class="list-group">
            <a href="#" class="list-group-item list-group-item-action">
                <i class="bi bi-person me-2"></i>个人资料
            </a>
            <a href="#" class="list-group-item list-group-item-action">
                <i class="bi bi-heart me-2"></i>我的收藏
            </a>
            <a href="#" class="list-group-item list-group-item-action">
                <i class="bi bi-credit-card me-2"></i>支付记录
            </a>
            <a href="#" class="list-group-item list-group-item-action">
                <i class="bi bi-gear me-2"></i>设置
            </a>
            <a href="#" class="list-group-item list-group-item-action text-danger">
                <i class="bi bi-box-arrow-right me-2"></i>退出登录
            </a>
        </div>
    </div>
</div>

<!-- 底部导航栏 -->
<nav class="navbar bottom-navbar">
    <div class="container">
        <ul class="nav w-100 justify-content-around">
            <li class="nav-item">
                <a class="nav-link active" href="#" data-bs-toggle="tab" data-bs-target="#home">
                    <i class="bi bi-house-door"></i>
                    <span>首页</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#" data-bs-toggle="tab" data-bs-target="#courses">
                    <i class="bi bi-list-check"></i>
                    <span>课程</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#" data-bs-toggle="tab" data-bs-target="#schedule">
                    <i class="bi bi-calendar-plus"></i>
                    <span>预约</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#" data-bs-toggle="tab" data-bs-target="#member">
                    <i class="bi bi-person"></i>
                    <span>我的</span>
                </a>
            </li>
        </ul>
    </div>
</nav>

<!-- 其他模态框保持不变 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script>
    // 修复切换时内容位置不对的关键代码
    document.addEventListener('DOMContentLoaded', function() {
        // 底部导航切换
        document.querySelectorAll('.bottom-navbar .nav-link').forEach(link => {
            link.addEventListener('click', function(e) {
                e.preventDefault();

                // 更新底部导航激活状态
                document.querySelectorAll('.bottom-navbar .nav-link').forEach(navLink => {
                    navLink.classList.remove('active');
                });
                this.classList.add('active');

                // 显示对应的内容区域
                const target = this.getAttribute('data-bs-target');
                document.querySelectorAll('.tab-pane').forEach(pane => {
                    pane.classList.remove('show', 'active');
                });
                document.querySelector(target).classList.add('show', 'active');

                // 滚动到顶部
                document.getElementById('mainContent').scrollTo(0, 0);
            });
        });

        // 生成日历
        function generateCalendar() {
            const calendarEl = document.getElementById('calendar');
            if (!calendarEl) return;

            const daysInMonth = 31;
            const firstDay = 1; // 假设5月1日是星期一

            // 添加空白格子
            for (let i = 0; i < firstDay; i++) {
                const emptyDay = document.createElement('div');
                emptyDay.style.width = '14%';
                emptyDay.style.height = '40px';
                calendarEl.appendChild(emptyDay);
            }

            // 添加日期
            for (let day = 1; day <= daysInMonth; day++) {
                const dayEl = document.createElement('button');
                dayEl.className = 'btn btn-sm btn-outline-secondary m-1';
                dayEl.style.width = '14%';
                dayEl.style.height = '40px';
                dayEl.textContent = day;

                // 标记今天
                if (day === 15) {
                    dayEl.className = 'btn btn-sm btn-primary m-1';
                }

                calendarEl.appendChild(dayEl);
            }
        }

        generateCalendar();

        // 预约按钮点击事件
        document.querySelectorAll('.btn-primary:not(.modal-footer .btn-primary)').forEach(btn => {
            if (btn.textContent.trim() === '预约') {
                btn.addEventListener('click', function(e) {
                    e.stopPropagation();
                    alert('预约成功！');
                });
            }
        });

        // 取消预约按钮点击事件
        document.querySelectorAll('.btn-outline-danger').forEach(btn => {
            btn.addEventListener('click', function(e) {
                e.stopPropagation();
                if (confirm('确定要取消此预约吗？')) {
                    this.closest('.class-slot').remove();
                    alert('已取消预约');
                }
            });
        });
    });
</script>
</body>
</html>